package net.zigin.nhi.could.waste.service.impl;

import net.zigin.commons.util.ReflectUtil;
import net.zigin.nhi.could.waste.dao.BaseMapper;
import net.zigin.nhi.could.waste.dao.SysMenuMapper;
import net.zigin.nhi.could.waste.model.SysMenu;
import net.zigin.nhi.could.waste.service.SysMenuService;
import net.zigin.nhi.could.waste.service.SysUserService;
import net.zigin.nhi.could.waste.vo.SysMenuVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*#################################################################*
# 说明:以下代码通过哲勤代码生成工具自动生成    
# 工具:GeneratorCode
# 作者:mgw1986                                                  
# 生成时间:2021-9-7 19:08:53                                               
##################################################################*/


/**
 * SysMenu服务实现类
 *
 * @author mgw1986
 * @version V1.0
 * @ClassName: SysMenuServiceImpl
 * @date 2021-9-7 19:08:53
 */
@Service
public class SysMenuServiceImpl extends AbstractServiceImpl<SysMenu, String> implements SysMenuService {
    @Autowired
    private SysMenuMapper sysMenuMapper;
    @Autowired
    private SysUserService sysUserService;

    @Override
    public BaseMapper<SysMenu, String> getMapper() {
        return sysMenuMapper;
    }

    @Override
    public List<SysMenuVo> infoByUserId(String userId) {
        List<SysMenu> sysMenus = sysMenuMapper.infoByUserId(userId);
        return ReflectUtil.copyProperties(sysMenus, SysMenuVo.class);
    }

}